package com.example.api.elk.component.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @name: Delete
 * @description:  做索引删除测试
 * @author: xw.s
 * @date: 2021/6/10-10:36
 */

/**
 * indexName 索引名
 * type 对应的索引类型
 * shards 分片数量 默认5
 * replicas 副本数量 默认1
 */
@Data
@Document(indexName = "delete", type = "_doc", shards = 1, replicas = 0) // indexName必须小写
public class Delete {
    @Id
    private Long id;
//    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    @Field(type = FieldType.Text)
    private String title;
    @Field(type = FieldType.Keyword)
    private String category;
    @Field(type = FieldType.Keyword)
    private String brand;
    @Field(index = false, type = FieldType.Keyword)
    private Double price;
    @Field(index = false, type = FieldType.Keyword)
    private String images;


}





























